import instance from '../utils/axios'
import {getToken} from '../utils/token'

export function getLoginApi({mobile,code}){
    return instance({
    url:"/v1_0/authorizations",
    method:'post',
    data:{
        mobile,
        code
    }
    })
}
export function getUserInfo(){
    return instance({
        url:'/v1_0/user/profile',
        method:'get',
        // headers:{
        //     Authorization:`Bearer ${getToken().token}`
        // }
    })
}
export function setUserInfo(data){
    return instance({
        url:'/v1_0/user/profile',
        method:'PATCH',
        data,
        // headers:{
        //     Authorization:`Bearer ${getToken().token}`
        // }
    })
}
export function setPhotoFile(fd){
    return instance({
        url:'/v1_0/user/photo',
        method:'PATCH',
        data:fd,
        // headers:{
        //     Authorization:`Bearer ${getToken().token}`
        // }
    })
}